<?php
if ( !defined( "IN_OP" ) )
{
    exit( "You can't access this file directly..." );
}
$ui = new UI();
$tpl = new Template2();
$conf = new Config();
$tpl->load( array( "main" => "live2.htm" ) );
$rs = getdb( "select * from lotto where open>='".date( "Y-m-d" )."' order by open" );
if ( $rs->eof )
{
    echo "<p>目前非搅珠时段！</p>";
    exit();
}
$open = $rs->f['open'];
$round = $rs->f['round'];
$lotto_id = $rs->f['id'];
$stopbet = $conf->get( "waitbet" );
if ( date( "Y-m-d" ) < $open )
{
    echo "<p>目前非搅珠时段</p>";
    exit();
}
else if ( date( "Y-m-d" ) == $open )
{
    if ( $stopbet <= date( "Hi" ) )
    {
        $tpl->set( "open", $open );
        $tpl->set( "round", d3( $round ) );
        $tpl->show( "main" );
    }
    else
    {
        echo "<p>目前非搅珠时段</p>";
        exit();
    }
}
else
{
    echo "<p>目前非搅珠时段</p>";
    exit();
}
?>